/*
 * Copyright(C) 2009, kesalin All rights reserved.
 * 
 * File name : LuoDnDAssist.h
 * Brief     : 
 * Version   : 1.0
 * Author    : kesalin@gmail.com
 * Date      : 2009-6-5
 */


#pragma once

#ifndef STDCALL
#define STDCALL __stdcall
#endif

/* */

#ifdef LUODND_EXPORTS
#define LUODNDASSIST_FUNC __declspec(dllexport)
#else
#define LUODNDASSIST_FUNC __declspec(dllimport)
#endif

/* */

extern "C"
HRESULT LUODNDASSIST_FUNC STDCALL LuoDnDAssist_Activate(
	LPCWSTR token,
	void**  obj);

/* */

namespace LuoDnDAssist {

// DataItem
struct DataItem {

	CLIPFORMAT  Format;
	const void* Data;
	SIZE_T      Size;

}; // DataItem

// DropParam
struct DropParam {

	IDataObject* pDataObj;     /* Data Object */

	DWORD        grfKeyState;  /* Mouse Status */
	int          x;
	int          y;

	DWORD        dwEffectMask; /* Effect Mask */

	DWORD        dwEffect;     /* Output */

}; // DropParam

// DropEventType
enum {
	DT_Enter,
	DT_Over,
	DT_Leave,
	DT_Drop,

	DT_FinalRelease
};

typedef HRESULT (STDCALL* DropCallback_t)(void*, int, DropParam*);

// UActivator
class UActivator {

public:

	virtual HRESULT STDCALL Initialize() = 0;

	virtual void STDCALL Uninitialize() = 0;

	/* DropSource */

	virtual HRESULT CreateDataObject(
		const DataItem* items,
		int             count,
		IDataObject**   pp) = 0;

	virtual HRESULT CreateDropSource(
		IDropSource** pp) = 0;

	/* DropTarget */

	virtual HRESULT CreateDropTarget(
		void*          context,
		DropCallback_t callback,
		IDropTarget**  pp) = 0;

}; // UActivator

/* */
extern HRESULT STDCALL Activate_import(LPCWSTR token, void ** obj);

} // namespace LuoDnDAssist

/* */

